package com.foreknow.demo5;


public class Test {

    public static void main(String[] args) {
        Manager manager = new Manager();
        Employee e1 = new Employee();
        e1.setEid(1001);
        e1.setEname("fender");
        e1.setAge(12);

        Employee e2 = new Employee();
        e2.setEid(1002);
        e2.setEname("fender2");
        e2.setAge(22);

        Employee e3 = new Employee();
        e3.setEid(1003);
        e3.setEname("fender3");
        e3.setAge(32);

        manager.insertEmployee(e1);
        manager.insertEmployee(e2);
        manager.insertEmployee(e3);

        //调用根据id查询的方法
        Employee e = manager.getQueryById(1002);
        System.out.println(e.getEid() + "--" + e.getEname());

        //调用查询所有员工信息的方法
        Employee[] employees = manager.getQueryAll();
        for (int i = 0;i<employees.length;i++) {
            System.out.println(employees[i].getEname());
        }

        //调用修改的方法(先根据id查询到某个员工)
        Employee ee = manager.update(e);
        System.out.println(ee.getEname());
    }
}
